﻿namespace 六
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
        }
    }
    class Animal
    {
        void voice() { }
    }
    class Cat:Animal
    {
        void voice()
        {
            Console.WriteLine("喵");
        }
    }
    class Pig:Animal
    {
        void voice()
        {
            Console.WriteLine("哼");
        }
    }
    class Dog:Animal
    {
        void voice()
        {
            Console.WriteLine("汪");
        }
    }
    class Store
    {
        Animal getlnstance(string n)
        {
            if(n=="dog")
            {
                Dog d = new Dog();
                return d;
            }
            else if(n=="pig")
            {
                return new Pig();
            }
            else
            {
                return new Cat();
            }
        }
    }
}
